﻿using System.Collections.Generic;

namespace Development.Factory
{
    public static class DataFactoryManager
    {
        private static Dictionary<string, FactoryDataBase> _dataFactorys = new Dictionary<string, FactoryDataBase>();
        public static void RegisterDataFactory(FactoryDataBase fact)
        {
            _dataFactorys.Add(fact.GetType().Name, fact);
            fact.Init();
        }

        public static T GetFactory<T>() where T : FactoryDataBase
        {
            return _dataFactorys[typeof(T).Name] as T;
        }
    }
}
